/*
 * AlarmEventPanel.java
 *
 * Created on October 30, 2007, 11:56 AM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

/**
 *
 * @author drew
 */

import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;
public class AlarmEventPanel extends JPanel
{
	final static Border border = new LineBorder (Color.BLACK, 1);
	AlarmEvent event;
	JLabel title, message, time;
	
	/** Creates a new instance of AlarmEventPanel */
	public AlarmEventPanel (AlarmEvent event)
	{
		this.event = event;
		this.setLayout (null);
		this.setBackground (Color.WHITE);
		this.setBorder (border);
		this.initComponents();
	}
	
	private void initComponents()
	{
		this.title = new JLabel(event.getTitle ());
		this.title.setBounds (15, 5, 100, 30);
		this.title.setFont (new Font("verdana", 1, 20));
		this.add (title);
		
		this.message = new JLabel(event.getMessage ());
		this.message.setBounds (20, 20, 430, 50);
		this.add (message);
		
		this.time = new JLabel(event.getDate ().getTime ()+"");
		this.time.setBounds (20, 50, 430, 30);
		this.add (time);
	}
	
	public int compareTo(AlarmEventPanel e)
	{
		return this.event.compareTo (e);
	}
}
